<?php
use App\Libraries\Calculator;

class CalculatorTest extends PHPUnit_Framework_TestCase{
	public function inputNumbers(){
		return [
			[1,1,2],
			[2.5,2.5,5],
			[-3, 1, -2]
		];
	}

	/**
	 * @dataProvider inputNumbers
	 */
	public function testAddNumbers($x,$y,$sum){
		$calc = new Calculator;

		$this->assertEquals($sum, $calc->add($x, $y));
	}

	/**
	 * @expectedException InvalidArgumentException
	 */
	public function testThrowsExceptionIfNonNumricIsPassed(){
		$calc = new Calculator;
		$calc->add('a', []);
	}	
}